package com.ty.day6;

import java.util.Scanner;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/13 14:07
 */
public class Four {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(),s,sum=0;
        for (int i = 1; i <= n; i++) {
            s=1;
            for (int j = 1; j <= i; j++) {
                s*=j;
            }
            sum+=s;
        }
        System.out.println(sum);
    }
}

